<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2>數據備份</h2>
    <ul>
      <li><a href="<?=site_url('admins/backup/add')?>">新增</a></li>
    </ul>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb">目前位置 &raquo; <a href="<?=site_url('admins/index')?>">控制台</a> &raquo; 系統管理 &raquo; <strong>數據備份</strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/backup')?>" method="get">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr>
            <th><?=lang('cart_number')?></th>
            <th>資料庫名稱</th>
            <th>操作人</th>
            <th>備份時間</th>
            <th style="text-align:center">動作</th>
          </tr>
        </thead>
        <tbody class="table">
          <?php if(isset($lists) && !empty($lists)):?>
          <?php foreach($lists as $key=>$list):
               $urls=site_url("admins/backup/%s/".$list['filename']);
          ?>
          <tr>
            <td><?=$key+1?></td>
            <td><?=$list['filename']?></td>
            <td><?=$list['author']?></td>
            <td><?=date($format_time,$list['add_time'])?></td>
            <td class="listaction"><a urls="<?=sprintf($urls,'reduction');?>" href="javascript:void(0);" class="l_reduction">還原</a><a href="<?=sprintf($urls,"download");?>" class="l_download">下載</a><a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete">刪除</a></td>
          </tr>
          <?php endforeach;?>
          <?php else:?>
          <tr>
            <td colspan="9" style="text-align:center" class="nodata"><p>沒有任何資料！</p></td>
          </tr>
          <?php endif;?>
        </tbody>
      </table>
      <!-- .tableactions ends -->
      <!-- .pagination ends -->
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('a.l_reduction').click(function(){
      if(confirm('您確定要還原嗎? (還原后之前動作的數據將回歸)')){
        var urls=$(this).attr('urls');
        location.href=urls;
      }
    })
  })
</script>
<?php $this->load->view('common/admin_footer');?>
